myApp.config(function($stateProvider,$urlRouterProvider,mePageLoadingProvider){
    mePageLoadingProvider.effect='Wave';
    //mePageLoadingProvider.container=$(mePageLoadingProvider.container).find('#content');
    //console.log(document.getElementById('#content'));
    $urlRouterProvider.when('','/');
    $stateProvider
        .state('list',{
            url:'/',
            templateUrl:'/views/list.html',
            resolve: {
                data: ['$q', function($q){
                    var defer = $q.defer();
                    setTimeout(function(){
                        defer.resolve('/');
                    }, 500);
                    return defer.promise;
                }]
            }
        })
        .state('talk',{
            url:'/talk',
            templateUrl:'/views/talk.html',
            resolve: {
                data: ['$q', function($q){
                    var defer = $q.defer();
                    setTimeout(function(){
                        defer.resolve('/talk');
                    }, 500);
                    return defer.promise;
                }]
            }
        })
        .state('test1',{
            url:'/test1',
            templateUrl:'/views/test1.html',
            controller:'test',
            resolve: {
                data: ['$q', function($q){
                    var defer = $q.defer();
                    setTimeout(function(){
                        defer.resolve('/test1');
                    }, 500);
                    return defer.promise;
                }]
            }
        })
        .state('adduser',{
            url:'/adduser',
            templateUrl:'/views/adduser.html',
            controller:'adduser',
            onEnter:function(){
                document.onkeyup=function(event){
                    if(event.keyCode==13){
                        $(this).find("#doc").click();
                    }
                };
            },
            onExit:function(){
                document.onkeyup=null;
            },
            resolve: {
                data: ['$q', function($q){
                    var defer = $q.defer();
                    setTimeout(function(){
                        defer.resolve('/test1');
                    }, 500);
                    return defer.promise;
                }]
            }
        })
        .state('talkTest',{
            url:'/talktest',
            templateUrl:'/views/talktest.html',
            resolve: {
                data: ['$q', function($q){
                    var defer = $q.defer();
                    setTimeout(function(){
                        defer.resolve('/test1');
                    }, 500);
                    return defer.promise;
                }]
            }
        })

});
